package com.xuhf;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Component;

@Component
public class MessageConsumer {

    @KafkaListener(topics = "my_test", groupId = "my-test-1")
    public void run(ConsumerRecord<String, String> record, Acknowledgment ack) {
        System.out.println("1111111111111111");
        String value = record.value();
        System.out.println("message: " + value);
        System.out.println("record: " + record);
        ack.acknowledge();
        System.out.println("1111111111111111");
    }

}
